/**
 * 
 */
package com.thon.dao.project.impl;


import org.springframework.stereotype.Repository;

import com.thon.dao.project.ProjectUnsupportDao;
import com.thon.dao.util.AbstractDao;
import com.thon.entity.project.ProjectUnsupport;

/**
 * @file ProjectUnsupportDaoImpl.java
 * @author Zemo
 * @mail zemochen@gmail.com
 * @data 2013年10月11日 上午11:32:53
 * @description: TODO
 */
@Repository
public class ProjectUnsupportDaoImpl extends AbstractDao<ProjectUnsupport> implements ProjectUnsupportDao{
	
	public ProjectUnsupportDaoImpl(){
		super(ProjectUnsupport.class);
	}

	@Override
	public Integer getUnSupportCount(Integer projectId) {
		String queryString="SELECT COUNT(*) FROM ProjectUnsupport pu WHERE pu.project.id=?";
		return count(queryString, projectId)==null?0:Integer.valueOf(count(queryString,projectId).toString());
	}
	@Override
	public Long countUnsupport(int projectId, int userId) {
		String sqlString="SELECT COUNT(*) FROM ym_project_unsupports pu WHERE pu.project_id=? and pu.user_id=?";
		return countBySql(sqlString, projectId,userId);
	}
}
